<script setup>
import { getUserInfo } from '@/api/userInfo'
import { computed, ref, reactive } from 'vue'

const department = ref('')

async function getInfo() {
    let result = await getUserInfo()
    department.value = result.data.department
    // console.log(department.vlaue)
}

getInfo()
</script>

<template>
    <div>
        <el-menu router
            style="padding-top:10px;padding-left: 10px;width: 200px;min-height: calc(100vh - 80px);">
            <el-menu-item index="workerInfo">
                <el-icon>
                    <Avatar />
                </el-icon>
                <span>个人信息</span>
            </el-menu-item>
            <el-menu-item index="leaveRequest">
                <el-icon><Promotion /></el-icon>
                <span>请假申请</span>
            </el-menu-item>
            <el-menu-item index="repair" v-if="department === '维修部'">
                <el-icon>
                    <Setting />
                </el-icon>
                <span>待维修事项</span>
            </el-menu-item>

        </el-menu>
    </div>
</template>